<form id="editForm" class="panel-body form-horizontal form-padding">
	<input type="hidden"  name="#(formModelName).id" class="form-control" value="#(o?o.id:'')">
	<div class="form-group">
		<label class="col-md-2 control-label">创建人</label>
		<div class="col-md-4">
			<input type="hidden"  name="#(formModelName).userid" class="form-control"  value="#if(o)#(o.userid)#else#(user.id)#end">
			<input type="text"  name="#(formModelName).create_user_name" class="form-control"  value="#if(o)#(o.create_user_name)#else#(user.name)#end" readonly>
		</div>
		<label class="col-md-1 control-label">部门</label>
		<div class="col-md-4">
			<input type="hidden"  name="#(formModelName).org_id" class="form-control"  value="#if(o)#(o.org_id)#else#(org.id)#end">
			<input type="text"  name="#(formModelName).create_org_name" class="form-control"  value="#if(o)#(o.create_org_name)#else#(org.name)#end" readonly>
		</div>
	</div>
		<div class="form-group">
			<label class="col-md-2 control-label">客户姓名</label>
			<div class="col-md-4">
				<input type="text"  name="#(formModelName).name" class="form-control"  value="#(o?o.name:'')" #if(view=='detail') readonly #end>
				<small class="help-block">请输入客户姓名</small>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-2 control-label">公司名称</label>
			<div class="col-md-4">
				<input type="hidden"  name="#(formModelName).company_id" class="form-control"  value="#(o?o.company_id:'')"  readonly>
				<input type="text"  name="#(formModelName).company_name" class="form-control"  value="#(o?o.company_name:'')"  readonly>
			</div>
			<label class="col-md-1 control-label">所在部门</label>
			<div class="col-md-4">
				<input type="text"  name="#(formModelName).org" class="form-control"  value="#(o?o.org:'')" #if(view=='detail') readonly #end>
				<small class="help-block">请输入所在部门</small>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-2 control-label">负责工作</label>
			<div class="col-md-4">
				<input type="text"  name="#(formModelName).work" class="form-control"  value="#(o?o.work:'')" #if(view=='detail') readonly #end>
				<small class="help-block">请输入负责工作</small>
			</div>
			<label class="col-md-1 control-label">相关工作关系</label>
			<div class="col-md-4">
				<input type="text"  name="#(formModelName).work_relation" class="form-control"  value="#(o?o.work_relation:'')" #if(view=='detail') readonly #end>
				<small class="help-block">请输入相关工作关系</small>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-2 control-label">电话</label>
			<div class="col-md-4">
				<input type="text"  name="#(formModelName).mobile" class="form-control"  value="#(o?o.mobile:'')" #if(view=='detail') readonly #end>
				<small class="help-block">请输入电话</small>
			</div>
			<label class="col-md-1 control-label">邮箱</label>
			<div class="col-md-4">
				<input type="text"  name="#(formModelName).email" class="form-control"  value="#(o?o.email:'')" #if(view=='detail') readonly #end>
				<small class="help-block">请输入邮箱</small>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-2 control-label">籍贯</label>
			<div class="col-md-9">
				<input type="text"  name="#(formModelName).birth_area" class="form-control"  value="#(o?o.birth_area:'')" #if(view=='detail') readonly #end>
				<small class="help-block">请输入籍贯</small>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-2 control-label">家庭住址</label>
			<div class="col-md-9">
				<input type="text"  name="#(formModelName).address" class="form-control"  value="#(o?o.address:'')" #if(view=='detail') readonly #end>
				<small class="help-block">请输入家庭住址</small>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-2 control-label">个人重要信息</label>
			<div class="col-md-9">
				<textarea rows="8" name="#(formModelName).important_info" class="form-control" #if(view=='detail') readonly #end></textarea>
				<small class="help-block">请输入个人重要信息</small>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-2 control-label">个人爱好</label>
			<div class="col-md-9">
				<textarea rows="8" name="#(formModelName).like_info" class="form-control" #if(view=='detail') readonly #end></textarea>
				<small class="help-block">请输入个人爱好</small>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-2 control-label">是否关键用户</label>
			<div class="col-md-9">
				<input id="is_important" class="magic-radio" type="radio" name="#(formModelName).is_important" value="1" #if(o&&o.is_important=="1") checked #end>
				<label for="is_important">是</label>
				<input id="not_important" class="magic-radio" type="radio" name="#(formModelName).is_important" value="1" #if(o&&o.is_important=="0") checked #end>
				<label for="not_important">否</label>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-2 control-label">备注</label>
			<div class="col-md-9">
				<textarea rows="8" name="#(formModelName).note" class="form-control" #if(view=='detail') readonly #end></textarea>
				<small class="help-block">请输入备注</small>
			</div>
		</div>
		<div class="form-group">
			<label class="col-md-2 control-label">备注</label>
			<div class="col-md-9">
				<textarea rows="8" name="#(formModelName).des" class="form-control" #if(view=='detail') readonly #end></textarea>
				<small class="help-block">请输入备注</small>
			</div>
		</div>
	#if(view=='detail')

	#else
	<div class="panel-footer">
		<div class="row">
			<div class="col-sm-8 col-sm-offset-3">
				<button class="btn btn-warning" type="reset" #if(view=='detail') disabled #end>重置</button>
				<button class="btn btn-primary" type="submit" #if(view=='detail') disabled #end>保存</button>
			</div>
		</div>
	</div>
	#end
</form>
<script>
	$(document).ready(function() {
		$('#editForm').bootstrapValidator({
			fields: {
				"#(formModelName).email":{
					validators: {
						emailAddress: {
							message: '*所属单位不能为空'
						}
					}
				},
				"#(formModelName).mobile":{
					validators: {
						regexp: {
							regexp: /^1\d{10}$/,
							message: '手机号格式错误'
						}
					}
				}
			}
		}).on("success.form.bv", function (e) {
			save();
			return false;//阻止表单跳转
		});
	});
</script>